package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 劵列表
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_third_party_list")
public class ThirdPartyList extends Model<ThirdPartyList> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "third_coupon_code", type = IdType.ASSIGN_ID)
    private String thirdCouponCode;
    /**
     * 兑换时间
     */
    @TableField("redemption_time")
    private LocalDateTime redemptionTime;
    /**
     * 使用时间
     */
    @TableField("use_time")
    private LocalDateTime useTime;
    /**
     * 卡卷状态:0未兑换1已兑换2已使用3已过期
     */
    @TableField("state")
    private Integer state;
    /**
     * 事件
     */
    @TableField("event")
    private String event;
    /**
     * 卡卷ID
     */
    @TableField("card_id")
    private String cardId;
    /**
     * 第三方券商
     */
    @TableField("third_party")
    private String thirdParty;

    public void freeData() {
        this.thirdCouponCode = null;
        this.redemptionTime = null;
        this.useTime = null;
        this.state = null;
        this.event = null;
        this.cardId = null;
        this.thirdParty = null;
    }
}
